home *** CD-ROM | disk | FTP | other *** search
/ QRZ! Ham Radio 8 / QRZ Ham Radio Callsign Database - Volume 8.iso / pc / files / dsp / 56200tar.z / 56200tar / 56200 / p6 < prev    next >
Text File  |  1992-04-28  |  10KB  |  170 lines

  1.  
  2.  
  3.          /***********************************************\
  4.          |**                                           **|
  5.          |**   DSP56200 CHIP DRIVER -DUAL FIR FILTERS  **|
  6.          |**                        -INTERRUPT DRIVEN  **|
  7.          |**                                           **|
  8.          \***********************************************/
  9.  
  10. /************************************************************************\
  11. *                                                                        *
  12. * VERSION        CHANGE                                                  *
  13. * -------        ------                                                  *
  14. *   1.1      In the flowchart for the interrupt service routine, when    *
  15. *            passnum = 1, the decision box "tap = FTL?" has been changed *
  16. *            to "tap = (1+2*FTL)?".                                      *
  17. *                                                                        *
  18. \************************************************************************/
  19.  
  20.  
  21. /************************************************************************\
  22. *                                                                        *
  23. *   This file contains a flowchart of the host processor program used    *
  24. *   to setup and service a single DSP56200 as two real-time FIR filters. *
  25. *   In this example, the host processor is interrupted at the beginning  *
  26. *   of every new sample period, signified by the reception of a rising   *
  27. *   edge on the DSP56200's START pin.  The host processor's interrupt    *
  28. *   pin is tied to the START pin of the DSP56200 through an inverter.    *
  29. *                                                                        *
  30. *   The example system is configured as shown below:                     *
  31. *                                                                        *
  32. *                            ------------                                *
  33. *                            | DSP56200 |                                *
  34. *                            ------------                                *
  35. *                                  ^                                     *
  36. *                                  |                                     *
  37. *                                  v                                     *
  38. *               -------    ------------------    -------                 *
  39. *      x1(t) -->| A/D |--->| Host Processor |--->| D/A |--> out1(t)      *
  40. *               -------    |                |    -------                 *
  41. *                          | (contains code |                            *
  42. *               -------    |  found in this |    -------                 *
  43. *      x2(t) -->| A/D |--->|     file)      |--->| D/A |--> out2(t)      *
  44. *               -------    ------------------    -------                 *
  45. *                                                                        *
  46. *                                                                        *
  47. *                   Figure 1. Dual FIR Filtering System                  *
  48. *                                                                        *
  49. *                                                                        *
  50. *                                                                        *
  51. *   There is only one DSP56200 in this example (i.e., not multiple       *
  52. *   DSP56200s in cascade), and it is configured in the Dual FIR filter   *
  53. *   mode (Figure 2) by writing the DSP56200's Configuration register.    *
  54. *   Since only 16 bit  results  are sent to each D/A Converter, the      *
  55. *   outputs are rounded to 16 bits by the DSP56200.                      * 
  56. *                                                                        *
  57. *                                                                        *
  58. *                                                                        *
  59. *                                                                        *
  60. *                           --------------                               *
  61. *                           |  1st  FIR  |                               *
  62. *               x1(n) ----->|   Filter   |-----> out1(n)                 *
  63. *                           |  (7 taps)  |                               *
  64. *                           --------------                               *
  65. *                                                                        *
  66. *                           --------------                               *
  67. *                           |  2nd  FIR  |                               *
  68. *               x2(n) ----->|   Filter   |-----> out2(n)                 *
  69. *                           |  (7 taps)  |                               *
  70. *                           --------------                               *
  71. *                                                                        *
  72. *                                                                        *
  73. *                   Figure 2. DSP56200 Configuration                     *
  74. *                                                                        *
  75. *                                                                        *
  76. \************************************************************************/
  77.  
  78.  
  79.  
  80. Flowchart #3: Dual FIR Filter Mode, Single Chip - Interrupt Driven
  81.  
  82.    Main Program:
  83.  
  84.  
  85.  
  86.                              -----------
  87.                              |  Begin  |
  88.                              -----------
  89.                                   |
  90.                      -----------------------------
  91.                      |  Disable START Interrupt  |
  92.                      -----------------------------
  93.                                   |
  94.                      -----------------------------
  95.                      | Set-up Global Variables:  |
  96.                      |       passnum = 2         |
  97.                      |       tap     = 0         |
  98.                      -----------------------------
  99.                                   |
  100.                       ----------------------------
  101.                       |  Enable START Interrupt  |
  102.                       ----------------------------
  103.                                   |
  104.                -----------------------------------------
  105.                | Perform Other Tasks or Idle:          |
  106.                |    At this time, the host can perform |
  107.                |    some other task.  Upon receiving   |
  108.                |    a START interrupt, the interrupt   |
  109.                |    service routine is then called.    |
  110.                -----------------------------------------
  111.  
  112.  
  113.  
  114.    Interrupt Service Routine:
  115.  
  116.  
  117.  
  118.         -----------
  119.         |  Begin  |
  120.         -----------
  121.              |
  122. ---------------------------
  123. |  Save Processor Status  |
  124. ---------------------------
  125.              |
  126.       --------------            --------------           
  127.     /  passnum = 2 ? \________/  passnum = 1 ? \_________________ 
  128.     \                / No     \                / No              |
  129.       --------------            --------------                   |
  130.              | Yes                     | Yes                     |
  131.   -------------------------      ---------------       ---------------------
  132.   | Write Bank 1 Regs:    |      | tap = tap+1 |       | Get 2 New Samples |
  133.   |    CONFIG  = 51 (hex) |      ---------------       |   From the A/Ds   |
  134.   |    FTL     = 06 (hex) |            |               ---------------------
  135.   -------------------------   --------------------               |
  136.              |                |      Write       |   -------------------------
  137.              |                | COEFF = ROM[tap] |   | Write the New Samples |
  138.   ------------------------    --------------------   | to the X1 and X2 Regs |
  139.   | Switch to Bank 0:    |             |             -------------------------
  140.   |    CONFIG = 50 (hex) |         ---------                     |
  141.   ------------------------       /   tap =   \____    ------------------------
  142.              |                   \ (1+2*FTL)?/ No |   |   Read Two Results   |
  143.    -----------------------         ---------      |   | from the OUTPUT Reg. |
  144.    | Write Bank 0 Regs:  |             | Yes      |   ------------------------
  145.    |    X1     = 0       |      ----------------  |              |
  146.    |    X2     = 0       |      | passnum =    |  |     --------------------
  147.    |    COEFF  = ROM[0]  |      |    passnum-1 |  |     | Send the Results |
  148.    |    RAMADR = 0       |      ----------------  |     |    to the D/As   |
  149.    -----------------------             |          |     --------------------
  150.              |                         |          |              |
  151.      ----------------                  |          |              |
  152.      | passnum =    |                  +<---------               |
  153.      |    passnum-1 |                  |                         |
  154.      ----------------                  |                         |
  155.              |                         |                         |
  156.              |                         |                         |
  157.               ------------------------>+<------------------------
  158.                                        |
  159.                                        |
  160.                          ------------------------------
  161.                          |  Restore Processor Status  |
  162.                          ------------------------------
  163.                                        |
  164.                          ------------------------------
  165.                          |  Return to Calling Program |
  166.                          ------------------------------
  167.  
  168.  
  169.  
  170.